<extend name="base"/>

<block name="main">
    <div class="fk-box">
        <div class="fb-xx">
            <volist name="data" id="vo">
                <div class="fbx-btn" onclick="checkType(this, '{$vo.name}')">{$vo.name}</div>
            </volist>

            <div class="clear"></div>
        </div>

        <textarea class="fb-wb content" placeholder="请写下您的宝贵意见..." placeholder-style="color:#aaa;"></textarea>

        <button class="fb-btn" onclick="submit()">提交</button>
    </div>
</block>

<block name="js">
    <script>
        var check_name;
        function checkType(that, type_name)
        {
            check_name = type_name;
            $('.fbx-btn').removeClass('active');
            $(that).addClass('active');
        }

        function submit()
        {
            var uid = '{$Think.session.uid}';
            var content = $('.content').val();

            var url = "{:U('/Home/Apis/addFeedback')}";

            $.post(url, {
                uid: uid,
                type_name: check_name,
                content: content
            }, function (res){
                layer.msg(res.msg)
                if(res.result == 1){
                    setTimeout(function () {
                        history.go(-1);
                    }, 500)
                }
            },'json')
        }
    </script>
</block>
